import greenfoot.*;  // (Actor, World, Greenfoot, GreenfootImage)

public class CrabWorld extends World
{
    /**
     * Create the crab world (the beach). Our world has a size 
     * of 560x560 cells, where every cell is just 1 pixel.
     */
    public CrabWorld() 
    {
        super(800, 800, 1);
        Crab c = new Crab();
        addObject(c, 200, 200);
        Worm q = new Worm();
        addObject(q, 400, 444);
        Worm w = new Worm();
        addObject(w, 785, 467);
        Worm e = new Worm();
        addObject(e, 568, 254);
        Worm r = new Worm();
        addObject(r, 400, 674);
        Worm t = new Worm();
        addObject(t, 543, 432);
        Worm y = new Worm();
        addObject(y, 132, 545);
        Lobster a = new Lobster();
        addObject(a, 578, 438);
        Lobster a1 = new Lobster();
        addObject(a1, 678, 238);
        showScore(0);
    }
    
    public void showScore(int count)
    {
        GreenfootImage image = getBackground();
        image.setColor(Color.GRAY);
        image.fillRect(35 ,10 ,110 ,30);
        image.setFont(new Font(18));
        image.setColor(Color.BLUE);
        image.drawString("吃虫数：" + count, 40, 30);
    }
}